refactor(dashnote): tidy auth UX + add delete confirmation modal#82
Conversation
The contract-ID editor and "Forget this device" button now live only in the Settings panel; the LoginModal's Advanced disclosure also hides for WIF input since identity-index is the only remaining knob. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Renames Login/Log in to Sign in across the IdentityCard, sidebar NavButton, LoginModal, and NotesWorkspace empty state. Hides the sidebar Sign in entry in authenticated and browsing modes (the IdentityCard menu handles those). Adds a primary Sign in button to the SettingsPanel unauth empty state matching the NotesWorkspace treatment. The e2e loginViaModal helper now routes through the IdentityCard menu when the session boots into browsing (rememberMe reload) since the sidebar entry is absent there. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces window.confirm with a DeleteNoteModal that shows the note title in body copy, uses a danger-styled Delete button, disables both actions while a delete is in flight, and ignores Escape, Cancel, and backdrop dismiss mid-delete to keep parent state in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughDashnote's authentication and deletion flows are refactored: a new DeleteNoteModal component replaces inline deletion with modal-driven confirmation, LoginModal removes contract-ID reuse and "Forget this device" features, UI labels change from "Login" to "Sign in", and SettingsPanel integrates a callback to trigger the login modal. ChangesAuth & Delete Flow Redesign
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@example-apps/dashnote/test/e2e/fixtures.ts`:
- Around line 131-141: The branch should stop depending on the visible "Browsing
(read-only)" text and instead detect the actual sign-in affordance; change the
logic in the block containing openIdentityMenu, navButton and getByText to first
probe for a sign-in control (e.g., try page.getByRole("menuitem", { name: /^sign
in$/i }).isVisible() or a navButton match for /sign in$/i) and use whichever
affordance is present to click it; keep using openIdentityMenu only when the
identity menu is reachable (detectable) and fall back to navButton when a
top-level sign-in button exists, rather than branching on getByText("Browsing
(read-only)").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 341efc28-9c6f-4a9c-abea-1843419c007e
⛔ Files ignored due to path filters (1)
example-apps/dashnote/public/favicon.svgis excluded by!**/*.svg
📒 Files selected for processing (15)
example-apps/dashnote/src/App.tsxexample-apps/dashnote/src/components/AppShell.tsxexample-apps/dashnote/src/components/DeleteNoteModal.tsxexample-apps/dashnote/src/components/IdentityCard.tsxexample-apps/dashnote/src/components/LoginModal.tsxexample-apps/dashnote/src/components/NotesWorkspace.tsxexample-apps/dashnote/src/components/SettingsPanel.tsxexample-apps/dashnote/test/DeleteNoteModal.test.tsxexample-apps/dashnote/test/IdentityCard.test.tsxexample-apps/dashnote/test/LoginModal.test.tsxexample-apps/dashnote/test/NotesWorkspace.test.tsxexample-apps/dashnote/test/SettingsPanel.test.tsxexample-apps/dashnote/test/e2e/auth.spec.tsexample-apps/dashnote/test/e2e/fixtures.tsexample-apps/dashnote/test/e2e/smoke.spec.ts
Summary
authenticated/browsing(IdentityCard menu handles those). Adds a primary Sign in button to the Settings unauth empty state matching the Notes treatment. The e2eloginViaModalhelper now routes through the IdentityCard menu when the session boots intobrowsing(rememberMe reload) since the sidebar entry is absent there.window.confirmwith aDeleteNoteModalthat shows the note title in body copy, uses a danger-styled Delete button, disables both actions while a delete is in flight, and ignores Escape, Cancel, and backdrop dismiss mid-delete to keep parent state in sync.🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Improvements